<?php
	require_once 'class/config_database.php';
	require_once 'class/kamar.php';
	$kamar_dao = new Kamar_Dao($host,$user,$pass,$dbnm);
	$kamar	   = new Kamar();
	
	$list_kamar 	= $kamar_dao->search_all();
	
	echo
	"<div id=\"myCarousel\" class=\"carousel slide\">
	<!-- Carousel items -->
	<div class=\"carousel-inner\">
    <div class=\"active item\"><center><img width=\"95%\" class=\"img-polaroid\" src=\"upload/428kamar kost surabaya.jpg\" width=\"150px\"></center>
	<div class=\"carousel-caption\"><p class=\"text-warning\"> ~GEMUK~ BOARDING HOUSE FINDER</p>
	</div>
	</div>";
	
	foreach($list_kamar as $kamar){
    echo "<div class=\"item\"><center><img width=\"95%\" class=\"img-polaroid\" src=\"upload/".$kamar->room_figure."\" width=\"150px\"></center>
	<div class=\"carousel-caption\"><p class=\"text-warning\">".$kamar->address."</p>
	</div></div>
    ";
	}
	
	echo
	"</div>
	<!-- Carousel nav -->
	<a class=\"carousel-control left\" href=\"#myCarousel\" data-slide=\"prev\">&lsaquo;</a>
	<a class=\"carousel-control right\" href=\"#myCarousel\" data-slide=\"next\">&rsaquo;</a>
	</div>";
	
	echo "<table class=\"well\" width=\"100%\">";
	$no=1;
	$sel=1;
	foreach($list_kamar as $kamar){
		switch($sel){
			case 1 : {
				echo "<tr><td width=\"30%\" valign=\"top\" align=\"right\"><center><font size=\"+2\" face=\"SHOWCARD GOTHIC\">".$kamar->rooms_name.
				"<br><input type=\"hidden\" name=\"rooms_no\" value=\"".$kamar->rooms_no."\"><img  class=\"img-polaroid\" src=\"upload/".$kamar->room_figure."\" width=\"150px\"><br></center>".
				"<form method=\"POST\"><input type=\"hidden\" name=\"rooms_no\" value=\"".$kamar->rooms_no."\"><br>
				<input class=\"btn btn-inverse\" name=\"Details\" type=\"submit\" value=\"Details\"></td></form>";
				$sel = $sel+1;
				break;
			}
			case 2 : {
				echo "<td width=\"30%\" valign=\"top\" align=\"right\"><center><font size=\"+2\" face=\"SHOWCARD GOTHIC\">".$kamar->rooms_name.
				"<br><input type=\"hidden\" name=\"rooms_no\" value=\"".$kamar->rooms_no."\"><img class=\"img-polaroid\" src=\"upload/".$kamar->room_figure."\" width=\"150px\"><br></center>".
				"<form method=\"POST\"><input type=\"hidden\" name=\"rooms_no\" value=\"".$kamar->rooms_no."\"><br>
				<input class=\"btn btn-inverse\" name=\"Details\" type=\"submit\" value=\"Details\"></td></form>";
				$sel = $sel+1;
				break;
			}
			case 3 : {
				echo "<td width=\"30%\" valign=\"top\" align=\"right\"><center><font size=\"+2\" face=\"SHOWCARD GOTHIC\">".$kamar->rooms_name.
				"<br><input type=\"hidden\" name=\"rooms_no\" value=\"".$kamar->rooms_no."\"><img class=\"img-polaroid\" src=\"upload/".$kamar->room_figure."\" width=\"150px\"><br></center>".
				"<form method=\"POST\"><input type=\"hidden\" name=\"rooms_no\" value=\"".$kamar->rooms_no."\"><br>
				<input class=\"btn btn-inverse\" name=\"Details\" type=\"submit\" value=\"Details\"></td></form>";
				$sel = 1;
				break;
			}      
		}
	}
	echo "</tr></table>";
?>